package com.cabal.common.enums;


/**
 * 错误状态
 *
 * @author shenkang
 * @date 2022年11月24日
 */
public enum ErrorStatusEnum {

	SUCCESS("1", "操作成功"), FAIL("0", "操作失败");

	private String code;
	private String name;

	ErrorStatusEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public static ErrorStatusEnum getName(String statusCode) {
		ErrorStatusEnum[] errorStatusEnums = ErrorStatusEnum.values();
		for (ErrorStatusEnum errorStatusEnum : errorStatusEnums) {
			if (errorStatusEnum.code.equals(statusCode)) {
				return errorStatusEnum;
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
